package service.impl;

import entity.BookList;
import service.IOperation;

/**
 * 删除图书
 */
public class DeleteBookIOperation implements IOperation {
    @Override
    public void work(BookList bookList) {
        System.out.println("您现在进行的是“删除图书”的操作");
        System.out.println("请输入图书名称：");
        String bookName = scanner.next();
        if (bookList.contain(bookName)) {
            if (bookList.deleteBook(bookName)) {
                System.out.println("删除图书成功！");
                return;
            }
        }
        System.out.println("删除失败！该图书可能已借出或本馆中未收藏。");
    }
}
